<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="cn.edu.thsis.dao.impl.jdbcUtils"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生管理</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/animate.css">
    <link rel="stylesheet" href="../css/font-awesome.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>论题列表</h5>
            </div>
            <div class="ibox-content">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>论题名称</th>
                        <th>论题类型</th>
                        <th>论题性质</th>
                        <th>出题人</th>
                        <th>学生</th>
                        <th>专业</th>
                    </tr>
                    </thead>
                    <tbody>
                    <%
                    String sql = "SELECT th.thsis_id,th.thsis_name,th.thsis_kind,th.thsis_class,th.tea_id,t.uid,t.uname tea_name,s.uid,s.uname stu_name,s.major,e.thsis_id,e.stu_id,e.accept FROM thsis th,teacher t,student s,enrol e WHERE th.tea_id = t.uid AND e.stu_id = s.uid AND th.thsis_id = e.thsis_id AND e.accept=2";
                    Connection conn = jdbcUtils.getConnection();
                    PreparedStatement ps = conn.prepareStatement(sql);
                    ResultSet rs = ps.executeQuery();
                    while (rs.next()) {
                    %>
                    <tr>
                        <td><%=rs.getString("thsis_name") %></td>
                        <td><%=rs.getString("thsis_class") %></td>
                        <td><%=rs.getString("thsis_kind") %></td>
                        <td><%=rs.getString("tea_name") %></td>
                        <td><%=rs.getString("stu_name") %></td>
                        <td><%=rs.getString("major") %></td>
                    </tr>
                    <%} %>
                    </tbody>
                </table>
            </div>
            </div>
        </div>
    </div>
    </div>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/content.js"></script>
</body>
</html>